import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long sum = 0;
        long sumSquares = 0;
        for (int i = 0; i < n; i++) {
            int num = scanner.nextInt();
            sum += num;
            sumSquares += (long) num * num;
        }
        long result = sum * sum - sumSquares;
        System.out.println(result / 2);
        scanner.close();
    }
}
